package com.wisezone.demo0218;

import java.lang.reflect.InvocationHandler;
import java.lang.reflect.Method;
import java.lang.reflect.Proxy;

public class MyHander implements InvocationHandler {
    private  Object object;
    public MyHander(Object object){
        this.object=object;
    }
    @Override
    public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
        Object o=null;
        ProxyLog log=new ProxyLog();
        log.printStart();
//        System.out.println("执行代理开始。。。。。。。");
        o=method.invoke(this.object,args);
//        System.out.println("执行代理结束。。。。。。。");
        log.printEnd();
        return o;
    }
}
